﻿@{
    ViewBag.Title = "Home Page";
}

<div id="tabs">
    <ul>
        <li>@Html.ActionLink("Today", "Today", "Todo")</li>
        <li>@Html.ActionLink("Other", "Other", "Todo")</li>
    </ul>
</div>

<div id="new-dialog">
@using (Html.BeginForm("Create", "Todo")) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Todo</legend>

        <div class="editor-label">
            @Html.Label("Title")
        </div>
        <div class="editor-field">
            @Html.Editor("Title")
            @Html.ValidationMessage("Title")
        </div>

        <div class="editor-label">
            @Html.Label("TodoDate")
        </div>
        <div class="editor-field">
            @Html.Editor("TodoDate")
            @Html.ValidationMessage("TodoDate")
        </div>

        <div class="editor-label">
            @Html.Label("HasCompleted")
        </div>
        <div class="editor-field">
            @Html.Editor("HasCompleted")
            @Html.ValidationMessage("HasCompleted")
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}
</div>

@section scripts {
    <script>
        $(function () {
            $("#tabs").tabs();
            $("#new-dialog").dialog({
                modal: true,
                width: 400,
                height: 400,
                autoOpen: false
            });
            $(".newdialog").live("click", function (evt) {
                evt.preventDefault();
                evt.stopPropagation();
                $("#new-dialog").dialog("open");
            });
        });
    </script>
}